package net.uhuijia.sys.syscode.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import net.uhuijia.appbase.service.CrudService;
import net.uhuijia.constants.DBConst;
import net.uhuijia.sys.syscode.persistence.dao.SysCodeDao;
import net.uhuijia.sys.syscode.persistence.model.SysCode;
import net.uhuijia.sys.syscode.persistence.model.SysCodeExample;
import net.uhuijia.sys.syscode.service.SysCodeService;
import net.uhuijia.sys.syscodedetail.persistence.dao.SysCodeDetailDao;
import net.uhuijia.sys.syscodedetail.persistence.model.SysCodeDetail;
import net.uhuijia.vo.sys.code.CodeVo;


@Service
@Transactional
public class SysCodeServiceImpl
     extends CrudService<SysCodeDao,SysCode,SysCodeExample> 
     implements SysCodeService{
	
    @Autowired
    private SysCodeDetailDao sysCodeDetailDao;
    
	@Override
	public List<CodeVo> getCodesByType(String type) {
		SysCodeDetail sysCodeDetail = new SysCodeDetail();
		sysCodeDetail.setIsEffective(DBConst.TRUE);
		sysCodeDetail.setType(type);
		return sysCodeDetailDao.getCodeDetailsByType(sysCodeDetail);
	}
	
}